package org.example.wratablecomparable;


import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

/**
 * @ClassName FlowReducer
 * @Author 小坏
 * @Date 2021/7/16、17:58
 * @Version 1.0
 * <p>
 * 1、Reducer的 k,v
 * 就对应这 map的输出 Text(电话号码), FlowBean(Bean对象)
 * <p>
 * 2、最终输出的也是 Text, FlowBean
 */
public class FlowReducer extends Reducer<FlowBean, Text, Text, FlowBean> {


    @Override
    protected void reduce(FlowBean key, Iterable<Text> values, Context context) throws IOException, InterruptedException {
        for (Text value : values) {
            context.write(value, key);
        }
    }
}
